from django.utils import translation
from .utils import get_translator

def translator(request):
    """ Make Translator available to all templates. """
    extra_vars = {}
    lang_code = translation.get_language()
    # Add our custom sushi_and_tears Translator object
    translator = get_translator(lang_code)
    extra_vars['translator'] = translator
    return extra_vars